<template>
  <div class="goods" @click="goodsDetail" :style="styleData" :data-id="item.goods_id">
    <div class="picture">
      <img v-lazy="{src:item.img640_url,loading:lazyPic}" alt="">
      <img class="mask" :src="maskPic" alt="">
    </div>
  </div>
  <!-- <div class="goods" @click="goodsDetail" :style="styleData">
    <div class="picture">
      <img v-lazy="{src:'http://img.shandjj.com/fdc/20190530/img/061e7ad68f266809b4fb226d53cb78ab_640_640.jpg',loading:lazyPic}" alt="">
      <img class="mask" :src="maskPic" alt="">
    </div>
  </div>  -->
</template>

<script>
  export default {
    props:['parentData','styleData','type'],
    data(){
      return{
        item:{},
        lazyPic:require('../../../assets/img/publicImg/loading_default.png') ,
        maskPic:require('../../../assets/img/loverDayVa/loverDayVa15.png') ,
        showDiscount:true
      }
    },
    created(){
      this.item=this.parentData
     },
    methods:{
      goodsDetail(){
        this.$emit('childEvent',this.item.goods_id);
      }
    }
  }
</script>

<style lang="less" scoped>
.goods{
  width: 3.12rem;
  margin-right: 0.15rem;
  margin-bottom: 0.15rem;
  font-family: '微软雅黑';
  background: #fff;
  font-size: 0.3rem;
  box-sizing: border-box;
  position: relative;
  .picture{
    width: 100%;
    padding-top: 100%;
    position: relative;
    img{
      width: 100%;height: 100%;
      position: absolute;
      top: 0;left: 0;
    }
    .mask{
      z-index: 5;
    }
  }
}
</style>